package org.black.phoneUtility.sms.reply.app.fragment;

import org.black.phoneUtility.sms.reply.database.dataModel.SmsReply;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;

public class SmsReplyReplyDateTimeAlwaysFragment extends Fragment {
	public static final String TAG = SmsReplyReplyDateTimeAlwaysFragment.class
			.getName();
	public static final String ARGUMENTS_REPLY_DATE_TIME_ALWAYS = "replyDateTimeAlways";

	public interface SmsReplyReplyDateTimeAlwaysListener {
		public void onChooseReplyDateTimeAlways(SmsReply replyDateTimeModeAlways);
	}

	private SmsReplyReplyDateTimeAlwaysListener smsReplyReplyDateTimeAlwaysListener;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Bundle bundle = getArguments();
		Object replyDateTimeAlwaysObject = bundle
				.getSerializable(ARGUMENTS_REPLY_DATE_TIME_ALWAYS);
		SmsReply smsReply = (SmsReply) replyDateTimeAlwaysObject;
		smsReply.setReplyDateTimeModeType(SmsReply.REPLY_DATE_TIME_MODE_ALWAYS_TYPE);
		smsReplyReplyDateTimeAlwaysListener
				.onChooseReplyDateTimeAlways(smsReply);
	}

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		try {
			smsReplyReplyDateTimeAlwaysListener = (SmsReplyReplyDateTimeAlwaysListener) activity;
		} catch (ClassCastException e) {
			throw new ClassCastException(activity.toString()
					+ " must implement SmsReplyReplyDateTimeAlwaysListener");
		}
	}
}
